package com.example.mvvmtemplate.utli;

import android.content.Context;
import android.content.SharedPreferences;

public class SharedPreferencesUtil {

    private static volatile SharedPreferencesUtil instance;

    private SharedPreferencesUtil() {
    }

    public static SharedPreferencesUtil getInstance() {
        if (instance == null) {
            synchronized (SharedPreferencesUtil.class) {
                if (instance == null) {
                    instance = new SharedPreferencesUtil();
                }
            }
        }
        return instance;
    }

    public SharedPreferences getSharedPreferences(Context context) {
        return context.getSharedPreferences("be_client", Context.MODE_PRIVATE);
    }

    public SharedPreferences.Editor getEditor(Context context) {
        return getSharedPreferences(context).edit();
    }
}
